-- clear_status
-- create by zhuangsl
-- 技能：清除某种状态

return {
    apply = function(source, target, skillId, round, para, extra)
        -- 清除指定的属性
        if para[1] ~= 0 then
            CombatStatusM.clearStatus(target, para[1]);
        end

        -- 有全清除属性或者配置为0时
        local prop = PropM.combine(source, "all_clear", skillId);
        local rand = DungeonM.getRandSeed("all_clear") % 1000;

        if para[1] == 0 or rand < PropM.apply(prop, 1) then
            -- 清空负面状态
            CombatStatusM.clearStatusByType(target, COM_STATUS_DEBUFF);
            CombatStatusM.clearStatusByType(target, COM_STATUS_DAMAGE);
            PropM.deleteProp(target, "debuff");
        end

        -- 增加命中动作
        -- SkillM.getSequence(target):hit(source, target, skillId);

        return { target, };
    end,

    parse = function(desc)
        local arr = string.explode(desc, ",");
        return { tonumber(arr[1]), };
    end,

    -- 解析技能描述
    parseDesc = function(source, skillId, desc, para)
        -- 不需要解析
        return desc;
    end,
};
